package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.FriendNewsByUserAndReplyData;
import cn.wolfcode.trip.base.domain.FriendNewsComment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FriendNewsCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FriendNewsComment record);

    FriendNewsComment selectByPrimaryKey(Long id);

    List<FriendNewsComment> selectAll();

    int updateByPrimaryKey(FriendNewsComment record);

    /**
     * 根据动态id查询所有的回复
     * @param id
     * @return
     */
    List<Long> selectFriendNewsCommentIdsByFriendNewsId(Long id);

    /**
     * 根据动态id,查询出回复人和被回复人
     * @param id
     * @return
     */
    List<FriendNewsByUserAndReplyData> selectReplyAndByUserByFriendNewsId(Long id);

    /**
     * 根据回复人和被回复人查询所有的回复
     * @param replyId
     * @param byUserId
     * @return
     */
    List<Long> selectFriendNewsCommentIdsByReplyAndByUser(@Param("replyId") Long replyId, @Param("byUserId") Long byUserId, @Param("friendNewsId") Long friendNewsId);

    /**
     * 查询动态所有回复
     * @param friendNewsCommentIds
     * @return
     */
    List<FriendNewsComment> selectAllCommentsDataOfFriendNews(@Param("friendNewsCommentIds") List<Long> friendNewsCommentIds);
}